package com.reizx.xocre;

import android.app.AndroidAppHelper;
import android.content.ContentResolver;
import android.content.Context;
import android.provider.Settings;
import android.widget.Toast;


import com.reizx.xocre.custom.wdj.WdjTutorial;
import com.reizx.xocre.log.XCoreLogUtil;
import com.reizx.xocre.system.System.Fuck_getString;
import com.reizx.xocre.system.System.Fuck_putString;
import com.reizx.xocre.system.Toast.Fuck_Toast;

import java.io.File;
import java.util.Map;

import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;

/**
 * Created by admin on 2017/4/5.
 */
public class Tutorial implements IXposedHookLoadPackage {
    @Override
    public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
        //XposedBridge.log("xpde: " + loadPackageParam.packageName);
        XCoreLogUtil.setTag("wandoujia_log");

        if (loadPackageParam.packageName.equals("com.reizx.xposeddemo") || loadPackageParam.packageName.equals("com.reizx.androidtest")) {
            XposedBridge.log("xcore: " + loadPackageParam.packageName);
            XposedHelpers.findAndHookMethod(Toast.class, "makeText", Context.class, CharSequence.class, int.class, new Fuck_Toast());
        }

        //豌豆荚测试
        if (loadPackageParam.packageName.equals("com.wandoujia.phoenix2")) {
            WdjTutorial.handleLoadPackage(loadPackageParam);
        }
    }
}
